package com.dlq.cloud.controller;

import com.dlq.cloud.pojo.User;
import com.dlq.cloud.service.impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private UserService userService;

    @RequestMapping(value="/user/{userName}")
    public User getUserByName(@PathVariable(value="userName") String userName){
        User user = userService.getUserByName(userName);
        return user;
    }
}
